package com.tanhua.dubbo.api;

import com.tanhua.model.domain.mysql.Announcement;
import com.tanhua.model.domain.mysql.User;

import java.util.List;

/**
 * @author lxb哦吼吼
 */
public interface UserApi {

    /**
     * description: 根据手机号码查询用户 <br>
     * version: 1.0 <br>
     * date: 2021/11/14 19:31 <br>
     * author: SangWu <br>
     *
     * @param mobile
     * @return com.tanhua.model.domain.mysql.User
     */
    User findByMobile(String mobile);

    /**
     * description: 保存新用户，返回用户id <br>
     * version: 1.0 <br>
     * date: 2021/11/14 19:21 <br>
     * author: SangWu <br>
     *
     * @param user
     * @return java.lang.Long
     */
    Long save(User user);

    /**
     * description: 查询用户 <br>
     * version: 1.0 <br>
     * date: 2021/11/14 19:32 <br>
     * author: SangWu <br>
     *
     * @param id
     * @return com.tanhua.model.domain.mysql.User
     */
    User findById(Long id);

    /**
     * description: 更新用户信息 <br>
     * version: 1.0 <br>
     * date: 2021/11/14 19:33 <br>
     * author: SangWu <br>
     *
     * @param user
     * @return void
     */
    void update(User user);

    /**
     * 查询用户 根据 环信id
     * @param huanxinId
     * @return
     */
    User findByHuanxin(String huanxinId);

    /**
     * 查询公告列表
     * @param page
     * @param pagesize
     * @return
     */
    List<Announcement> findAnnouncements(Integer page, Integer pagesize);
}
